/**
 * ClassName: ValueTransferTest
 * Package: PACKAGE_NAME
 * Description:
 *
 * @Author harkjeans
 * @Create 2025/9/1 18:43
 * @Version 1.0
 */
public class ValueTransferTest {
    public static void main(String[] args) {

        System.out.println(args);//[Ljava.lang.String;@776ec8df

        ValueTransferTest test = new ValueTransferTest();
        System.out.println(test);//ValueTransferTest@4eec7777

        Data data = new Data();
        System.out.println(data);//Data@41629346

        data.m = 10;
        data.n = 20;
        System.out.println("m = " + data.m + ", n = " + data.n);

        test.swap(data);//传递的是指针
        System.out.println("m = " + data.m + ", n = " + data.n);


    }
    public void swap(Data data){
        int temp = data.m;
        data.m = data.n;
        data.n = temp;
    }
}

class Data{
    int m;
    int n;
}//class为引用数据类型，为指针。
